package io.renren.modules.pet.enums;

import lombok.Getter;

@Getter
public enum ApplicantPetsEnum {
    STATUS_0(0, "猫咪"),
    STATUS_1(1, "狗狗"),
    STATUS_2(2, "猫狗双全"),
    STATUS_3(3, "暂无");

    private Integer index;
    private String chn;

    ApplicantPetsEnum(Integer index, String chn) {
        this.index = index;
        this.chn = chn;
    }

    /**
     * 通过索引获取中文表示
     * @param index
     * @return
     */
    public static String getChnByIndex (int index) {
        ApplicantPetsEnum[] applicantPetsEnums = ApplicantPetsEnum.values();
        for (ApplicantPetsEnum applicantPetsEnum : applicantPetsEnums) {
            if (applicantPetsEnum.index.equals(index)) {
                return applicantPetsEnum.chn;
            }
        }
        return null;
    }
}
